package com.zz.ecommerce.common.bean.qdc.db;

import com.zz.bundles.cache.dict.DictTag;
import com.zz.ecommerce.common.constants.DictConstants;
import com.zz.ecommerce.common.constants.TableConstants;
import com.zz.ecommerce.utils.SqlType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 申报给青岛海关的订单报文头信息保存表
 */
public class TOrderHeadQdc implements Serializable {

    private static final long serialVersionUID = 834551477053485208L;

    private String id;

    /**
     * 订单号
     */
    @SqlType(inTemplate = true)
    private String orderId;

    /**
     * 进出口类型 I-进口；E-出口
     */
    @SqlType(inTemplate = true)
    private String ieFlag;

    /**
     * 贸易方式 0-	一般贸易
     * 1-	保税贸易
     */
    @SqlType(inTemplate = true)
    private String tradeMode;

    /**
     * 商户代码 出口10位海关编码；
     * 进口为备案商户的组织机构代码
     */
    @SqlType(inTemplate = true)
    private String ebCode;

    /**
     * 商户名称
     */
    @SqlType(inTemplate = true)
    private String ebName;

    /**
     * 商品总价
     */
    @SqlType(inTemplate = true)
    private BigDecimal totalPayment;

    /**
     * 币制
     */
    @SqlType(inTemplate = true)
    private String currCode;

    /**
     * 买方名称
     */
    @SqlType(inTemplate = true)
    private String buyerName;

    /**
     * 买方证件类型 1-身份证
     * 2-护照
     * 3-军官证
     */
    @SqlType(inTemplate = true)
    private String buyerCertType;

    /**
     * 买方证件号
     */
    @SqlType(inTemplate = true)
    private String buyerCertId;

    /**
     * 贸易国别
     */
    @SqlType(inTemplate = true)
    private String buyerCountry;

    /**
     * 买方电话
     */
    @SqlType(inTemplate = true)
    private String buyerTel;

    /**
     * 收货地址
     */
    @SqlType(inTemplate = true)
    private String deliveryAddr;

    /**
     * 电商平台代码
     */
    @SqlType(inTemplate = true)
    private String ebPlatId;

    /**
     * 业务类型：0-B2C，1-B2B
     */
    private String businessType;

    /**
     * 备注
     */
    @SqlType(inTemplate = true)
    private String note;

    @SqlType(type = "date",format = "yyyy-MM-dd hh24:mi:ss",qryStart = "createTimeStart",qryEnd = "createTimeEnd")
    private String createTime;

    @SqlType(inTable = false)
    private String createTimeStart;

    @SqlType(inTable = false)
    private String createTimeEnd;

    @SqlType(isEquals=true)
    private String status;

    @SqlType(type = "date",format = "yyyy-MM-dd hh24:mi:ss")
    private String statusTime;

    private String orgId;

    private String operId;

    /**
     * 是否已生成清单
     */
    private String ifCreate;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return 订单号
     */
    public String getOrderId() {
        return orderId;
    }

    /**
     * @param orderId 订单号
     */
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /**
     * @return 进出口类型 I-进口；E-出口
     */
    public String getIeFlag() {
        return ieFlag;
    }

    /**
     * @param ieFlag 进出口类型 I-进口；E-出口
     */
    public void setIeFlag(String ieFlag) {
        this.ieFlag = ieFlag;
    }

    /**
     * @return 贸易方式 0-	一般贸易
     * 1-	保税贸易
     */
    public String getTradeMode() {
        return tradeMode;
    }
    public String getTradeModeDisplay() {
        return DictTag.dictItem(DictConstants.TRADE_MODE_QDC,tradeMode);
    }
    /**
     * @param tradeMode 贸易方式 0-	一般贸易
     *                  1-	保税贸易
     */
    public void setTradeMode(String tradeMode) {
        this.tradeMode = tradeMode;
    }

    /**
     * @return 商户代码 出口10位海关编码；
     * 进口为备案商户的组织机构代码
     */
    public String getEbCode() {
        return ebCode;
    }

    /**
     * @param ebCode 商户代码 出口10位海关编码；
     *               进口为备案商户的组织机构代码
     */
    public void setEbCode(String ebCode) {
        this.ebCode = ebCode;
    }

    /**
     * @return 商户名称
     */
    public String getEbName() {
        return ebName;
    }

    /**
     * @param ebName 商户名称
     */
    public void setEbName(String ebName) {
        this.ebName = ebName;
    }

    /**
     * @return 商品总价
     */
    public BigDecimal getTotalPayment() {
        return totalPayment;
    }

    /**
     * @param totalPayment 商品总价
     */
    public void setTotalPayment(BigDecimal totalPayment) {
        this.totalPayment = totalPayment;
    }

    /**
     * @return 币制
     */
    public String getCurrCode() {
        return currCode;
    }

    public String getCurrDisplay() {
        return DictTag.getCargoParamVal(DictConstants.S_CURRENCY_E,currCode,"CODE_C","NAME_C");
    }

    /**
     * @param currCode 币制
     */
    public void setCurrCode(String currCode) {
        this.currCode = currCode;
    }

    /**
     * @return 买方名称
     */
    public String getBuyerName() {
        return buyerName;
    }

    /**
     * @param buyerName 买方名称
     */
    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    /**
     * @return 买方证件类型 1-身份证
     * 2-护照
     * 3-军官证
     */
    public String getBuyerCertType() {
        return buyerCertType;
    }

    public String getBuyerCertTypeDisplay() {
        return DictTag.dictItem(DictConstants.ID_TYPE,buyerCertType);
    }

    /**
     * @param buyerCertType 买方证件类型 1-身份证
     *                      2-护照
     *                      3-军官证
     */
    public void setBuyerCertType(String buyerCertType) {
        this.buyerCertType = buyerCertType;
    }

    /**
     * @return 买方证件号
     */
    public String getBuyerCertId() {
        return buyerCertId;
    }

    /**
     * @param buyerCertId 买方证件号
     */
    public void setBuyerCertId(String buyerCertId) {
        this.buyerCertId = buyerCertId;
    }

    /**
     * @return 贸易国别
     */
    public String getBuyerCountry() {
        return buyerCountry;
    }
    public String getBuyerCountryDisplay() {
        return DictTag.getCargoParamVal(DictConstants.S_NATIONS,buyerCountry,"NATIONCO","NATIONCN");
    }
    /**
     * @param buyerCountry 贸易国别
     */
    public void setBuyerCountry(String buyerCountry) {
        this.buyerCountry = buyerCountry;
    }

    /**
     * @return 买方电话
     */
    public String getBuyerTel() {
        return buyerTel;
    }

    /**
     * @param buyerTel 买方电话
     */
    public void setBuyerTel(String buyerTel) {
        this.buyerTel = buyerTel;
    }

    /**
     * @return 收货地址
     */
    public String getDeliveryAddr() {
        return deliveryAddr;
    }

    /**
     * @param deliveryAddr 收货地址
     */
    public void setDeliveryAddr(String deliveryAddr) {
        this.deliveryAddr = deliveryAddr;
    }

    /**
     * @return 电商平台代码
     */
    public String getEbPlatId() {
        return ebPlatId;
    }

    /**
     * @param ebPlatId 电商平台代码
     */
    public void setEbPlatId(String ebPlatId) {
        this.ebPlatId = ebPlatId;
    }

    /**
     * @return 备注
     */
    public String getNote() {
        return note;
    }

    /**
     * @param note 备注
     */
    public void setNote(String note) {
        this.note = note;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getStatus() {
        return status;
    }

    public String getStatusDisplay() {
        return DictTag.dictItem(DictConstants.ORDER_STATUS_QDC,status);
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatusTime() {
        return statusTime;
    }

    public void setStatusTime(String statusTime) {
        this.statusTime = statusTime;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getOperId() {
        return operId;
    }

    public void setOperId(String operId) {
        this.operId = operId;
    }

    public String getCreateTimeStart() {
        return createTimeStart;
    }

    public void setCreateTimeStart(String createTimeStart) {
        this.createTimeStart = createTimeStart;
    }

    public String getCreateTimeEnd() {
        return createTimeEnd;
    }

    public void setCreateTimeEnd(String createTimeEnd) {
        this.createTimeEnd = createTimeEnd;
    }

    public String getBusinessType() {
        return businessType;
    }

    public void setBusinessType(String businessType) {
        this.businessType = businessType;
    }

    public String getIfCreate() {
        return ifCreate;
    }

    public void setIfCreate(String ifCreate) {
        this.ifCreate = ifCreate;
    }

    @Override
    public String toString() {
        return "TOrderHeadQdc{" +
                "id='" + id + '\'' +
                ", orderId='" + orderId + '\'' +
                ", ieFlag='" + ieFlag + '\'' +
                ", tradeMode='" + tradeMode + '\'' +
                ", ebCode='" + ebCode + '\'' +
                ", ebName='" + ebName + '\'' +
                ", totalPayment=" + totalPayment +
                ", currCode='" + currCode + '\'' +
                ", buyerName='" + buyerName + '\'' +
                ", buyerCertType='" + buyerCertType + '\'' +
                ", buyerCertId='" + buyerCertId + '\'' +
                ", buyerCountry='" + buyerCountry + '\'' +
                ", buyerTel='" + buyerTel + '\'' +
                ", deliveryAddr='" + deliveryAddr + '\'' +
                ", ebPlatId='" + ebPlatId + '\'' +
                ", businessType='" + businessType + '\'' +
                ", note='" + note + '\'' +
                ", createTime='" + createTime + '\'' +
                ", createTimeStart='" + createTimeStart + '\'' +
                ", createTimeEnd='" + createTimeEnd + '\'' +
                ", status='" + status + '\'' +
                ", statusTime='" + statusTime + '\'' +
                ", orgId='" + orgId + '\'' +
                ", operId='" + operId + '\'' +
                '}';
    }
}
